import multiprocessing
import time
a=1
def add_a1(i):
    print("这里是进程：",i)
    global a
    a+=1
    print(a)
    time.sleep(3)

if __name__=='__main__':
    for i in range(5):
        m=multiprocessing.Process(target=add_a1,args=(i,))
        m.start()
        print(m.pid)
    #print(multiprocessing.active_children())
    while multiprocessing.active_children()!=[]:
        print(multiprocessing.active_children())
    print("stop")
